package com.example.dbmeta.meta.common;

import lombok.Data;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.time.Instant;

@Data
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public class BaseEntity {
//    Id
//    @GeneratedValue(strategy= GenerationType.AUTO)
//    private Long id;
    @CreatedBy
    private String codecreateUserId;
    @CreatedDate
    private Instant codecreateTime;
    @LastModifiedBy
    private String codelastModifiedUserId;
    @LastModifiedDate
    private Instant codelastModifiedTime;
    @Version
    private Integer codeversion;
}